﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>

<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>同發冷氣工程有限公司</title> 
   
    <ext:XScript ID="XScript1" runat="server">
        <script>
            var addTab = function (tabPanel, id, url, menuItem,t) {
                var tab = tabPanel.getComponent(id);

                if (!tab) {
                    tab = tabPanel.add({ 
                        id       : id, 
                        title    : t, 
                        closable : true,
                        menuItem : menuItem,
                        loader   : {
                            url      : url,
                            renderer : "frame",
                            loadMask : {
                                showMask : true,
                                msg      : "Loading " + url + "..."
                            }
                        }
                    });

//                    tab.on("activate", function (tab) {
//                        #{MenuPanel1}.setSelection(tab.menuItem);
//                    });
                }
            
                tabPanel.setActiveTab(tab);
            }
        </script>
    </ext:XScript>
    <link href="css/fonts.css" rel="stylesheet" type="text/css" />
</head>
<body>
    <form id="form1" runat="server">
    <ext:ResourceManager ID="ResourceManager1" runat="server">
    </ext:ResourceManager>
    <ext:Viewport runat="server" Layout="border">
        <Items>
           <ext:Panel ID="Panel6" runat="server" Collapsible="True" Layout="accordion"     Region="West"
                Split="true" Title="功能菜单" Width="175">
               <TopBar>
                    <ext:Toolbar ID="Toolbar3"  runat="server" Split="False"  LabelAlign="Right">
                        <Items>
                            <ext:Label runat="server" ID="lbUsername" Text="aaaa"></ext:Label>
                            <ext:Button runat="server" ID="aaa" Text="退出" Icon="UserGo">
                                <DirectEvents>
                                    <Click OnEvent="LogOut"></Click>
                                </DirectEvents> 
                            </ext:Button> 
                        </Items>
                    </ext:Toolbar> 
                </TopBar> 
                <Items>
                     <ext:MenuPanel ID="MenuPanel1" runat="server" Region="West"   Title="推销工作" Icon="Monitor" Width="185">
                        <Menu runat="server">
                            <Items>
                                <ext:MenuItem  runat="server" Text="推銷名單" Icon="Group">
                                    <Listeners>
                                        <Click Handler="addTab(#{TabPanel1}, 'MenuItem3', 'CustomersGo.aspx', this,'推銷名單');" />
                                    </Listeners>
                                </ext:MenuItem> 
                                <%-- 
                                <ext:MenuItem  runat="server" Icon="ApplicationCascade" Text="[快捷]未处理">
                                    <Listeners>
                                        <Click Handler="addTab(#{TabPanel1}, 'weichuli', 'SinglePage.aspx?ls=4', this,'未处理');" />
                                    </Listeners>
                                </ext:MenuItem>
                                <ext:MenuItem  runat="server" Icon="ApplicationError" Text="[快捷]没接">
                                    <Listeners>
                                        <Click Handler="addTab(#{TabPanel1}, 'meijie', 'SinglePage.aspx?ls=1', this,'没接');" />
                                    </Listeners>
                                </ext:MenuItem>
                                <ext:MenuItem runat="server" Icon="ApplicationLightning" Text="[快捷]跟进">
                                    <Listeners>
                                        <Click Handler="addTab(#{TabPanel1}, 'genjin', 'SinglePage.aspx?ls=3', this,'跟进');" />
                                    </Listeners>
                                </ext:MenuItem> 
                                <ext:MenuItem   runat="server" Text="客户查询 " Icon="Find">
                                    <Listeners>
                                        <Click Handler="addTab(#{TabPanel1}, 'kehuchaxun', 'search.aspx', this,'客户查询');" />
                                    </Listeners>
                                </ext:MenuItem>
                                --%> 
                                <ext:MenuItem  runat="server" Text="類別情況 " Icon="Brick">
                                     <Listeners>
                                        <Click Handler="addTab(#{TabPanel1}, 'lebieqingkuang', 'Catalogs.aspx?uid=0', this,'類別情況');" />
                                    </Listeners>
                                </ext:MenuItem>
                               
                                <ext:MenuItem    runat="server" Text="员工统计 " Icon="Report">
                                     <Listeners>
                                        <Click Handler="addTab(#{TabPanel1}, 'yuangongtongji', 'userStat.aspx', this,'员工统计');" />
                                    </Listeners>
                                </ext:MenuItem>
                                
                                
                            </Items>
                        </Menu>
                    </ext:MenuPanel> 
                    
                    <ext:MenuPanel ID="MenuPanel2" runat="server" Region="West"   Title="系统管理" Icon="Monitor" Width="185">
                        <Menu ID="Menu1" runat="server">
                            <Items>
                                <ext:MenuItem   runat="server" Text="用户管理 " Icon="UserEarth">
                                     <Listeners>
                                        <Click Handler="addTab(#{TabPanel1}, 'MenuItem1', 'userEdit.aspx', this,'用户管理');" />
                                    </Listeners>
                                </ext:MenuItem>
                                <%--
                                <ext:MenuItem   runat="server" Text="Excel管理" Icon="PageExcel">
                                       <Listeners>
                                        <Click Handler="addTab(#{TabPanel1}, 'excelguanli', 'Excel/Files.aspx', this,'Excel管理');" />
                                    </Listeners>
                                </ext:MenuItem> 
                                   --%>
                            </Items>
                        </Menu>
                    </ext:MenuPanel> 
                     
                </Items>
            </ext:Panel>
            <ext:Panel ID="Panel9" runat="server" Layout="Fit" Region="Center" Title="功能显示区">
                <Items>
                    <ext:TabPanel ID="TabPanel1" runat="server" />
                    </Items>
            </ext:Panel>
        </Items>
    </ext:Viewport>
    </form>
</body>
</html>
